package drexcel;

import java.sql.Connection;

import org.junit.Before;
import org.junit.Test;
import org.springframework.context.ApplicationContext;
import org.springframework.context.support.ClassPathXmlApplicationContext;

import com.mchange.v2.c3p0.ComboPooledDataSource;
//import com.teradata.fbj.pojo.ConnData;

public class test1 {
		
		private ApplicationContext ac;
	
		
		@Test
		public void test1() throws Exception{
			ComboPooledDataSource dataSource = new ComboPooledDataSource();
			dataSource.setDriverClass("com.mysql.jdbc.Driver"); 
			dataSource.setJdbcUrl("jdbc:mysql://localhost:3306/how2java"); 
			dataSource.setUser("root");  
			dataSource.setPassword("fubjie");
			dataSource.setInitialPoolSize(3);
			dataSource.setMaxPoolSize(6);
			dataSource.setMaxIdleTime(1000);
			
			// ---> 从连接池对象中，获取连接对象  
	        Connection con = dataSource.getConnection();  
	        String sql = "delete from user";
	        con.prepareStatement(sql).executeUpdate();
	        //con关闭
	        con.close();
	        
		}
}	
